<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2018/4/23
  Time: 8:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->


    <!--引入 jQuery 文件 -->
    <script src="./jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="./bootstrap/bootstrap/css/bootstrap.css">
    <script src="./bootstrap/bootstrap/js/bootstrap.js"></script><!--引入 限制登陆样式css -->
    <link href="/bootstrap/signin.css" rel="stylesheet">

    <title>网易理财</title>
    <style type="text/css">
        #testa{
            position: absolute;
            top:48%;
            left:60%;
            width: 300px;
            float: right;
        }

        .form-signin{
            position: relative;
            margin-left: 1.6%;margin-top:7%;

        }

        #ss{
            position: absolute;
            margin-left: 96%;
            margin-top: -13%;
            width:200px;
            height:30px;
            color: red;
        }
        #box{background-image:url("/photos/5.jpg");background-position:center center;background-repeat:no-repeat;background-size:cover;}

    </style>


</head>
<body id="box">


<div class="container"  style="position: absolute;left: 40%" >

    <form class="form-signin" id="formreg22">
        <input type="hidden" name="registerId"   />
        <label  style="text-indent:2em;">用户名：</label>
        <input type="text" class="form-control "  name="registerName" value="" placeholder="请输入您的用户名" ><br><br>
        <label  style="text-indent:3em;">密码：</label>

        <input type="password" class="form-control "  name="registerPass" value="" placeholder="请输入密码" ><br><br>
        <%--
                <label  style="text-indent:2em;">手机号：</label>
                <input name="phone" type="text"  class="form-control" placeholder="登录的手机号：+86:" required autofocus ><br><br>

                <label  style="text-indent:2em;">验证码：</label>
                <input name="meg" type="text"  class="form-control" placeholder="动态验证码" required >

                <div id="testa2"><a href="javascript:settime2()">动态获取验证码</a></div><br><br><br>
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="rememberMe" value="1"> 记住密码 &nbsp;&nbsp;
                    </label>
                </div>--%>

        <input  type="button" class="btn btn-lg btn-primary btn-block" value="注册" id="regbtn22"/><br><br>
        <a href="/personlogin.jsp" >
            <div style="border:1px solid #FBAF37;background:#fff;color:#FBAF37;width:43%;padding:10px 20px;border-radius: 5px; margin-left: 6.3em;text-align: center;" class="ss check2">
              去登陆
            </div>
        </a>

    </form>

</div> <!-- /container -->

<script type="text/javascript">

    $("#regbtn22").click(function(){

        $.ajax({
             type:"Post",
            //data:$("#formreg22").serialize(),
             data:{registerName:$("[name='registerName']").val(),registerPass:$("[name='registerPass']").val()},
             url:"http://localhost:8076/login/saveRegister",
            success:function(result){

                //console.log(result)
                alert(result);

                if(result=="注册成功"){

                    location.href="/haha.jsp"
                }else{

                    location.href="/personreg.jsp"
                }

            }

        });
        //location.href="/haha.jsp"

    })




  /*  var countdown=60;
    function settime2() {
        setTimeout(test,0)
        $.ajax({
            type: "Post",
            data:{phone:$("[name='phone']").val()},
            url: "http://localhost:8077/login/sendmessage",
            success: function (result) {

                alert(result)
                location.reload();
            }
        })

    }
    function test(){
        $("#testa2").html("<div style='margin-left: 70px'><font color='red'>"+countdown--+"</font></div>")
        if( countdown>0){
            setTimeout(test,1000)
        }else{
            $("#testa").html("<a  onclick='settime2()'>动态获取验证码</a>")
            countdown=60;
        }
    }*/


</script>

</body>
</html>
